package edu.hunau.recommend.controller;

import edu.hunau.recommend.common.R;
import edu.hunau.recommend.pojo.Category;
import edu.hunau.recommend.service.CategoryService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author name
 * @creater 2022-09-20-9:57
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Resource
    private CategoryService categoryService;

    @RequestMapping("/list")
    public R list(){

        List<Category> list = categoryService.selectAll();
        return R.ok().data("list",list);
    }
}
